import { NestFactory } from '@nestjs/core';
import { AppModule } from './root/app.module';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';

const swaggerOptions = new DocumentBuilder()
  .setTitle('api文档')
  .setDescription('文档')
  .setVersion('1.0')
  .build();

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  const document = SwaggerModule.createDocument(app, swaggerOptions);
  SwaggerModule.setup('api-docs', app, document, { explorer: true });
  await app.listen(3002);
}
bootstrap();
